package src.model.gameObject.ability;

import src.model.gameObject.GameObject;
import src.model.gameWorld.ActualMap;
import src.model.gameWorld.LookupTable;

/**
 * <b>Overview</b><br>
 * <p>This class constructs the necessary abilities to populate in a GameObject. This allows an abilityType to
 * be passed in, and get the proper Ability out, without having to know what type it was.</p>
 * <br><br>
 * <b>Responsibilites</b><br>
 * <p>Create Abilities.</p>
 * <br><br>
 * <b>Collaborators</b>
 * <ul>
 * <li>AbilityType - To know which Ability to construct.</li>
 * <br><br>
 * <b>Implementor:</b> Tristan Lohman<br>
 * <b>Tester:</b> Brent Mofitt<br>
 * @author Tristan
 *
 */
public class AbilityFactory {
	
	/**
	 * This will construct an ability with the parameters passed in. The AbilityType determines which Abilty
	 * will be created. The rest of the parameters are necessary for the various constructors.<br>
	 * NOTE: Not all Abilities have been implemented yet, so many of the constructors are incomplete.
	 * @param go The GameObject that this will belong to.
	 * @param aType The AbilityType. Determines which constructor to call.
	 * @param lookup The LookupTable that most constructors will need.
	 * @param am The ActualMap that many constructors need.
	 * @return The Ability created.
	 */
	public static Ability constructAbility(GameObject go, AbilityType aType, LookupTable lookup, ActualMap am){
		switch(aType){
		case HEALTH: 			return new Health(go, lookup);
		case DETECTTRAP:		return new DetectTrap(go, lookup, am);
		case VIEW:				return new View(go, am, lookup);
		case COUNTERATTACK:		return new CounterAttack(go, lookup);
		case RENEWINGRESOURCE:	return new RenewingResource(go);
		case UPKEEP:			return new Upkeep(go);
		case PASSABLE:			return new Passable(go, lookup);
		case AETELEPORT:		return new AETeleport(go, am, lookup);
		case AEMODIFYHEALTH:	return new AEModifyHealth(go, am, lookup);
		case AEINSTANTDEATH:	return new AEIntstantDeath(go, am, lookup);
		case STORERESOURCE:		return new StoreResource(go);
		case INVISIBLE:			return new Invisible(go);
		default: 				return null;
		}
	}
}
